//- Copyright (C) 2018-2022 Chatopera Inc, <https://www.chatopera.com>
//- 
//- Licensed under the Apache License, Version 2.0 (the "License");
//- you may not use this file except in compliance with the License.
//- You may obtain a copy of the License at
//- 
//-  http://www.apache.org/licenses/LICENSE-2.0
//- 
//-  Unless required by applicable law or agreed to in writing, software
//- distributed under the License is distributed on an "AS IS" BASIS,
//-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//- See the License for the specific language governing permissions and
//- limitations under the License.
//-
    原始 Freemarker 文件位置：https://gitlab.chatopera.com/chatopera/cskefu/blob/760e130e770a96a43e8f6f2c8a1eb0885c0bbf90/contact-center/app/src/main/resources/templates/apps/setting/agent/acd.html
    该页面在 /apps/setting/include/left.pug 中被注释掉，此处是没有完全转化的 Pug 文件
    如果提供这个页面，需要参考 Freemarker 原文件完成转化或参考实现
extends /apps/include/layout.pug
block content
    .layui-side.layui-bg-black
        .layui-side-scroll
            include /apps/setting/include/left.pug
    .layui-body
        .layui-side-scroll
            .row
                .col-lg-12
                    h1.site-h1(style='background-color:#FFFFFF;')
                        | ACD策略（坐席分配策略）
                        //  <#if userList??>（${userList.totalElements!''}）</#if>
                        span(style='float:right;')
                            button.layui-btn.layui-btn-small.green(href='/admin/user/add.html', data-toggle='ajax', data-width='750', data-title='创建新用户').
                                添加策略

                    .row(style='padding:5px;')
                        .col-lg-12
                            table.layui-table(lay-skin='line')
                                colgroup
                                    col(width='20%')
                                    col(width='15%')
                                    col(width='25%')
                                    col(width='15%')
                                    col(width='10%')
                                    col(width='15%')
                                    col(width='1%')
                                    col
                                thead
                                    tr
                                        th 用户
                                        th 姓名
                                        th 电子邮件
                                        th 手机
                                        th 坐席
                                        th 注册时间
                                        th(style='white-space:nowrap;', nowrap) 操作
                                tbody
                                    // 								<#if userList?? && userList.content??>
                                    // 								<#list userList.content as user>
                                    // 								<tr>
                                    // 								  <td>
                                    // 										<a href="">
                                    // 											<i class="layui-icon headimg">&#xe612;</i>
                                    // 											<div style="margin-left:50px;margin-top:0px;">
                                    // 												${user.username!''}
                                    // 												<div style="color:#aaaaaa;font-size:12px;">
                                    // 													系统管理员
                                    // 												</div>
                                    // 											</div>
                                    // 										</a>
                                    //
                                    // 								  </td>
                                    // 								  <td>${user.uname!''}</td>
                                    // 								  <td>${user.email!''}</td>
                                    // 								  <td>${user.mobile!''}</td>
                                    // 								  <td>
                                    // 								  	<#if user.agent>
                                    // 								  		<i class="layui-icon" style="color:#19a55d;">&#xe618;</i>
                                    // 								  	</#if>
                                    // 								  </td>
                                    // 								  <td>${user.createtime!''}</td>
                                    // 								  <td style="white-space:nowrap;" nowrap="nowrap">
                                    // 								  		<a href="/admin/user/edit.html?id=${user.id!''}" data-toggle="ajax" data-width="750" data-title="编辑用户信息">
                                    // 								  			<i class="layui-icon">&#xe642;</i>
                                    // 								  			编辑
                                    // 								  		</a>
                                    // 								  		<a href="/admin/user/delete.html?id=${user.id!''}" style="margin-left:10px;" data-toggle="tip" data-title="请确认是否删除记录？">
                                    // 								  			<i class="layui-icon" style="color:red;">&#x1006;</i>
                                    // 								  			删除
                                    // 								  		</a>
                                    // 								  </td>
                                    // 								</tr>
                                    // 								</#list>
                                    // 								<#else>
                                    // 								<tr>
                                    // 									<td colspan="20" style="height:400px;">
                                    // 										<div class="ukefu-empty" style="background: none">
                                    // 											<i class="layui-icon">&#xe63a;</i>
                                    // 											<div style="">还没有ACD策略</div>
                                    // 										</div>
                                    // 									</td>
                                    // 								</tr>
                                    // 								</#if>
                    .row(style='padding:5px;')
                        .col-lg-12#page(style='text-align:center;')
script.
    layui.use(['laypage', 'layer'], function(){
              var laypage = layui.laypage
              ,layer = layui.layer;

              laypage({
                    cont: 'page'
                    // ,pages: <#if userList??>${userList.totalPages}<#else>0</#if> //总页数
                    // ,curr:<#if userList??>${userList.number+1}<#else>0</#if>
                    ,groups: 5 //连续显示分页数
                    ,jump:function(data , first){
                        if(!first){
                            location.href = "/admin/user/index.html?p="+data.curr ;
                        }
                    }
               });
            });

